package nativejpa.test.jpa.hsql;

import javax.persistence.Table;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.JoinColumn;

/**
 * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
 * @create 2009-3-13 14:53:31
 */
@Entity
@Table(name = "Item")
public class Item {
    @Id
    @Column(name = "Item")
    private int item;

//    @JoinColumn(name = "InvoiceID", columnDefinition = "SELECT * FROM Invoice WHERE ID=$InvoiceID")
    @JoinColumn(name = "InvoiceID", referencedColumnName = "ID")
    private Invoice invoice;

//    @JoinColumn(name = "ProductId", columnDefinition = "SELECT * FROM Product WHERE ID=$ProductId")
    @JoinColumn(name = "ProductId", referencedColumnName = "ID")
    private Product product;

    public int getItem() {
        return item;
    }

    public void setItem(int item) {
        this.item = item;
    }

    public Invoice getInvoice() {
        return invoice;
    }

    public void setInvoice(Invoice invoice) {
        this.invoice = invoice;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }
}